import type { ComponentPublicInstance, ExtractPropTypes } from "vue";

export const circleSliderProps = {
  circleWidth: {
    type: Number,
    default: 14,
  },
  sliderColor: {
    type: String,
    default: "#232829",
  },
  // 0 - 1
  progress: {
    type: Number,
    default: 0,
  },
  max: {
    type: Number,
    default: 1,
  },
  min: {
    type: Number,
    default: 0,
  },
};

export const circleSliderEmits = {
  "update:progress": (progress: number) => progress || true,
  onAnimationStart: () => true,
  onAnimationEnd: () => true,
};

export type CircleSliderProps = ExtractPropTypes<typeof circleSliderProps>;
export type CircleSliderExpose = {
  startSpin: (targetPercnet: number, animationEnd: () => void) => void;
};

export type CircleSliderInstance = ComponentPublicInstance<
  CircleSliderExpose,
  CircleSliderProps
>;
